﻿using System;
using System.Collections.Generic;
using System.Web;

/// <summary>
/// Summary description for publicmethod
/// </summary>
public class publicmethod
{
    public publicmethod()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public static string cutArticleTitle(string title, int length)
    {
        if (title.Length > length)
        {
            return title.Substring(0, length - 3) + "...";
        }
        else
        {
            return title;
        }
    }

    public static string cutArticleAddTime(string title)
    {
        try
        {
            return title.Substring(0, title.IndexOf(' '));
        }
        catch (Exception)
        {
            return title;
        }
    }
}